import { QuickOptAlertPanel } from "../equipment/popupPanels/QuickOptAlertPanel";
import { ILayer } from "../../../mvc/interfaces/ILayer";
import { Language } from "../../../../extend/language/Language";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { ItemData } from "../../resource/info/ItemData";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { GameDefConfig } from "../../resource/GameDefConfig";
import { ColorConfig } from "../../resource/ColorConfig";
import { Cache } from "../../cache/Cache";
//class WuXingQuickGradeUpAlert
    
    export  class WuXingQuickGradeUpAlert extends QuickOptAlertPanel
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            this.title = Language.getString(26325);
            return;
        }

        protected /* override */ onButtonClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=arg1.target;
            switch (loc1) 
            {
                case _btnOK:
                {
                    this.dispatchEvent(new DataEvent(EventName.WuXingQualityAlertOk));
                    break;
                }
            }
            super.onButtonClick(arg1);
            return;
        }

        public /* override */ set imageItemData(arg1: ItemData)
        {
            super.imageItemData = arg1;
            var loc1=HTMLUtil.addColor(GameDefConfig.instance.getWuxingTileName(arg1.wxColor + 1), ColorConfig.instance.getWuxingColor(arg1.wxColor + 1));
            _nameLabel.htmlText = Language.getString(26401) + arg1.htmlName;
            _targetLabel.htmlText = Language.getString(26402) + loc1;
            _warmLabel.htmlText = Language.getStringByParam(26400, loc1);
            showWarmLabel(Cache.instance.role.wuxingInfo.qualityAutoBuy);
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            _warmLabel.htmlText = Language.getString(26340);
            return;
        }
    }
